<?php
if(Common::is_post('Thêm mới'))
{	
	$entity=$_POST;
	$entity['_table_name']='tbl_news';
	$entity['create_time']=time();
	$entity['alias']=Common::no_mark($entity['title']);
	$query=Db::build_query_insert($entity);
	Db::mysql_query($query,Config::$FETCH_MODE_NONE);
	Common::header_location('Thêm mới thành công.','index.php?page=news-index');
} 
?>
<form  class='form-administrator' method='post'>
	<fieldset>
		<legend><?php echo Layout::$title;?></legend>
		<label>
			<span>Tiêu đề</span>
			<?php echo Control::input_type_text('title');?>
		</label>
		<label>
			<span>Hình minh họa</span>
			<?php echo Control::ckfinder('image');?>
		</label>
		<label>
			<span>Trích dẫn</span>
			<?php echo Control::textarea('quote');?>
		</label>
		<label>
			<span>Nội dung</span>
			<?php echo Control::ckeditor('content');?>
		</label>
		<div>
			<?php echo Control::input_type_submit('Thêm mới')?>
		</div>
	</fieldset>
</form>
